﻿#include "set.h"
#include "ui_set.h"

#include "dataFormate.h"
set::set(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::set)
{
    ui->setupUi(this);

    // 设置是否互斥
    box->setExclusive(true);
    // 将需要互斥的按钮全部添加到 QButtonGroup 中
    box->addButton(ui->systemSetting_Btn,0);
    box->addButton(ui->passwordManagement_Btn,1);
    box->addButton(ui->productIntrodution_Btn,2);
    this->setWindowFlags(Qt::Dialog|Qt::FramelessWindowHint);
    ui->stackedWidget->setCurrentIndex(0);

}

set::~set()
{
    delete ui;
}

void set::on_systemSetting_Btn_clicked()
{
    ui->stackedWidget->setCurrentIndex(0);
}

void set::on_passwordManagement_Btn_clicked()
{
    ui->stackedWidget->setCurrentIndex(1);
}

void set::on_productIntrodution_Btn_clicked()
{
    ui->stackedWidget->setCurrentIndex(2);
}

void set::changeEvent(QEvent* event)
{
    switch (event->type())
    {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        QWidget::changeEvent(event);
        break;
    }
}
